#ifndef BUBBLEFRAME_H
#define BUBBLEFRAME_H
#include<QFrame>
#include<QPaintEvent>
#include<QHBoxLayout>
#include<QPainter>
#include"global.h"

class BubbleFrame:public QFrame
{
    Q_OBJECT
public:
    BubbleFrame(ChatRole role,QWidget*parent=nullptr);
    void setMargin(int margin);
    void setWidget(QWidget*w);
protected:
    virtual void paintEvent(QPaintEvent*e)override;
private:
    QHBoxLayout* m_pHLayout;
    ChatRole m_role;
    int m_margin;
};

#endif // BUBBLEFRAME_H
